Enhanced Querying, "Submodel" Support#2
Conversation
|
@whyrusleeping if you had two minutes to have a look at this, would be greatly appreciated! |
dcwalk
left a comment
There was a problem hiding this comment.
Just a q: are there some more urgent TODOs (or all of them) that we should be pulling out as issues?
|
All By that logic all See also my comment on datatogether/archive#16 |
|
Thanks! I'm going to merge on account of the age of this PR & modest approval from @dcwalk. I'll try to re-surface the concepts here through documentation in the near future. |
This PR brings some necessary enhancements to make sql_datastore support a more "natural" implementation of the datastore.Query command. It also establishes patterns for doing one-to-many style relationships by leveraging Key Paths.
Here's an example from an upcoming
datatogether/archivepull request:Breaking Changes
model.NewSQLModel(id string)is nowmodel.NewSQLModel(key datastore.Key)NewSQLModel used to be passed a string id value. The original intent behind this was to have consumers of the
sql_datastorepackage do less work extracting Model ID's from keys. This turns out to not be enough information to support sub-model type relationships, where the parent ID is passed back in via the key path. So, this PR chances the interface to pass back the entire key. I think this is a better way to go.